Skip to content

[STREAM-1180] Adjust media handling based on alerting leader#994

Merged
hjon merged 14 commits intodevelopfrom
STREAM-1180
Apr 17, 2026
Merged

[STREAM-1180] Adjust media handling based on alerting leader#994
hjon merged 14 commits intodevelopfrom
STREAM-1180

Conversation

@hjon
Copy link
Copy Markdown
Collaborator

@hjon hjon commented Apr 17, 2026

The basic idea is that as different clients become the alerting leader, the other clients should not be handling media (such as eager persistent connections) or headsets. But we still want them to be capable of outbound calls. However, the initial clients using alerting leader will be using their streaming-client connections as the alerting leader, so the SDK cannot simply react to alerting leader changes on its own. This PR allows clients to tell the SDK how it should handle media (and adjusts headset orchestration slightly so an alerting leader takes priority).

MERGE CHECKLIST

  • Tests have been updated, added, or removed and the testing matrix has passed.
  • Documentation has been updated or added.
  • Changelog has been updated with ticket or issue number, link to the ticket, and a description of the changes.
  • Branch has been built in the BitBucket wrapper repository.
  • Pull request title is formatted as [STREAM-<ticket number>] - <description of changes> or [<issue number>] - <description of changes>.
  • Release pull requests include someone from the PureScale team for approval.
    • Build release branch in wrapper repository and make sure it is tagged with next on npm.

# Conflicts:
#	changelog.md
const broadcastSpy = jest.fn();
proxyService['sdk']._streamingConnection.messenger.broadcastMessage = broadcastSpy;
proxyService['sdk']._mediaHandling = MediaHandling.alertingLeaderMedia;
const device = { deviceId: 'device1Id', groupId: 'device1GroupId', label: 'device1Label', kind: 'audioinput' } as any;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Unexpected any. Specify a different type.

Suggested change
const device = { deviceId: 'device1Id', groupId: 'device1GroupId', label: 'device1Label', kind: 'audioinput' } as any;
const device = { deviceId: 'device1Id', groupId: 'device1GroupId', label: 'device1Label', kind: 'audioinput' } as unknown;

Comment thread src/types/enums.ts
/** These currently only affect softphone media */
export enum MediaHandling {
/** Handle all media; headset controls use traditional orchestration */
standardMedia = 'standard-media',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be standard-media or legacy-media? Basically I'm asking if the alerting-leader behavior will/should become the new default when this is flipped on.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this probably a question for a PM too. I don't really want to see us manage so many different states in the future if we can avoid it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair question. The alerting leader behavior will not be the new default because it only applies to the clients we've hardcoded. However, I think it is possible that it will become the default at some point in the future. I think it's far enough away and unknown enough to not consider it legacy yet. 🙂

@hjon hjon merged commit 7bb9c54 into develop Apr 17, 2026
21 checks passed
@hjon hjon deleted the STREAM-1180 branch April 17, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants